﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace MagicalDesktop
{
    /// <summary>
    /// Interaction logic for ShellWindow.xaml
    /// </summary>
    public partial class ShellWindow : Window
    {
        public ShellWindow()
        {
            InitializeComponent();
            this.DataContext = Shell.Instance;
            Shell.Instance.RefreshView = RefreshShellWindow;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            RefreshShellWindow();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            _mainScreen.Content = new AddAccount();
        }

        private void RefreshShellWindow()
        {
            if (Shell.Instance.ActiveServices.Length > 0)
            {
                _mainScreen.Content = new RecentMessage();
            }
            else
                _mainScreen.Content = new TextBlock { Text = "No Accounts Added", FontSize=26 };
        }
    }
}
